function save_outputs(Xmean,ns_time,data_name,folder_name)

% 1. hip position 
hip_pos = Xmean.x_meanHP';%-x_meanHP(1);
save([folder_name '/' data_name '_hippos.mat'],'hip_pos','ns_time');

% 2. Linearized hip position 
Linear_hippos = Xmean.x_meanHPL';
save([folder_name '/' data_name '_LinearHippos.mat'],'Linear_hippos','ns_time');

% 3. non-stance slope
ns_slope = Xmean.x_meanNSL';
save([folder_name '/' data_name '_nsslope.mat'],'ns_slope','ns_time');

% 4. linearized non-stance slope
Linear_nsslope = Xmean.x_meanLNS';
save([folder_name '/' data_name '_LinearNSslope.mat'],'Linear_nsslope','ns_time');


% 5. stance COM slope
st_COM = Xmean.x_meanSCOM';
save([folder_name '/' data_name '_stCOM.mat'],'st_COM','ns_time');

% 6. linearized COM slope
Linear_stCOM = Xmean.x_meanSCOML';
save([folder_name '/' data_name '_LinearSTcom.mat'],'Linear_stCOM','ns_time');

% 7. non-stance COM slope
ns_COM = Xmean.x_meanNSCOM';
save([folder_name '/' data_name '_nsCOM.mat'],'ns_COM','ns_time');


% 8. linearized non-stance COM slope
Linear_nsCOM = Xmean.x_meanNSCOM';
save([folder_name '/' data_name '_LinearNSCOM.mat'],'Linear_nsCOM','ns_time');

% % % 5. stance torso slope
% % s_torso = Xmean.x_meanST';
% % save([folder_name '/' data_name '_storso.mat'],'s_torso','ns_time');
% % 
% % % 6. linearized stance torso slope
% % Linear_s_torso = Xmean.x_meanLST';
% % save([folder_name '/' data_name '_LinearStorso.mat'],'Linear_s_torso','ns_time');
% % 
% % % 7. non-stance torso slope
% % ns_torso=Xmean.x_meanNST';
% % save([folder_name '/' data_name '_nstorso.mat'],'ns_torso','ns_time');
% % 
% % % 8. linearized non-stance torso slope
% % Linear_ns_torso = Xmean.x_meanLNST';
% % save([folder_name '/' data_name '_LinearNStorso.mat'],'Linear_ns_torso','ns_time');
% % 
% 9. COM
COMpos=Xmean.x_meanCOMP';
save([folder_name '/' data_name '_com.mat'],'COMpos','ns_time');

% 10. linearized non-stance torso slope
Linear_COMpos = Xmean.x_meanCOMPL';
save([folder_name '/' data_name '_LinearCOM.mat'],'Linear_COMpos','ns_time');

% 11.stance length of COM
st_COMLen = Xmean.x_meanSCOMLen';
save([folder_name '/' data_name '_stCOMLen.mat'],'st_COMLen','ns_time');

% 12.non-stance length of COM
ns_COMLen = Xmean.x_meanNSCOMLen';
save([folder_name '/' data_name '_nsCOMLen.mat'],'ns_COMLen','ns_time');

% 13.stance length of Hip
st_HipLen = Xmean.x_meanSHipLen';
save([folder_name '/' data_name '_stHipLen.mat'],'st_HipLen','ns_time');

% 14.non-stance length of Hip
ns_HipLen = Xmean.x_meanNSHipLen';
save([folder_name '/' data_name '_nsHipLen.mat'],'ns_HipLen','ns_time');

% 15.COM Angle
COMangle = Xmean.x_meanCOMangle';
save([folder_name '/' data_name '_COMangle.mat'],'COMangle','ns_time');

% 16.COM Angle
hipV = Xmean.x_meanHipV';
save([folder_name '/' data_name '_HipV.mat'],'hipV','ns_time');

end